package bean.general;

import java.util.HashMap;

public class Preference {
	public static final String TABLE_NAME = "preferences";
	
	////////////////////////////////////////////////////////////
	//Preferences name
	public static final String HOME_HEADER = "home_header";
	public static final String HOME_TITLE = "home_title";
	public static final String STYLE_IN_USE = "style_in_use";
	public static final String SITE_NAME = "site_name";
	////////////////////////////////////////////////////////////
	
	////////////////////////////////////////////////////////////
	//Bean fields
	private String id;
	private String value;
	private String description;
	private String option;
	////////////////////////////////////////////////////////////
	
	////////////////////////////////////////////////////////////
	//Column names
	public static final String ID_COL = "idpreferences";
	public static final String VALUE_COL = "value";
	public static final String DESCRIPTION_COL = "description";
	public static final String OPTION_COL = "option";
	////////////////////////////////////////////////////////////
	
	/**
	 * Get the info from a table ROW by column name
	 * @param line
	 */
	public Preference(HashMap<String, String> line) {
		id = line.get(ID_COL);
		value = line.get(VALUE_COL);
		description = line.get(DESCRIPTION_COL);
		option = line.get(OPTION_COL);
	}

	////////////////////////////////////////////////////////////
	//Getters and setters
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getOption() {
		return option;
	}
	public void setOption(String option) {
		this.option = option;
	}
	////////////////////////////////////////////////////////////

	@Override
	public String toString() {
		return id + ": " + value;
	}
}
